﻿##exercicio 9.2 - Analise Exploratoria c/ 2 variaveis

country <- c(Brazil, Argentina, França, Alemanha, Uruguai, Espanha, Italia) #eixo x
w.cup <- c(5, 2, 3, 4, 2, 1, 4) #eixo y

ana.exp <- function (x, y, names=c ("country", "w.cup"), cores= c("green", "orange"){
	if (length(country) != length(w.cup)) {
	stop ("Atenção! Seus vetores possuem tamanhos diferentes")
	}
	#fazer gráfico
	x11() #abre a telinha do gráfico
	par(mfrow = c(2,2)) #definindo os parâmetros do gráfico a ser visualizado
	multhist (list(country,w.cup), main="Histograma", col=" ", xlab="Escala", ylab="Frequência")
	hist(w.cup) #faça um histograma
	plot(w.cup~country, col="purple", xlab="Campeões Mundiais", ylab="Número de Taças")
	
	return(list(sum.x=summary(country), sum.y=summary(w.cup), coef.xy = cor(country,w.cup)))

	} 


		
